import * as actionType from './constants.js';
import { reqClassify } from '@/api/index.js' 

export const changeClassifyData =(data) =>{
    return {
        data,
        type:actionType.CHANGE_CLASSIFYDATA
    }
}

export const getClassifyData = (data) => {
    // console.log("进去成功...............");
    return (dispatch) =>{
        reqClassify()
            .then((res) =>{
                // console.log(res,'getClassifyData');    
                dispatch(changeClassifyData(res.data.data))
            })
            .catch((e) =>{
                console.log('出错了');
            })
    }
}